<?php

class Model_UseCategoryMapper {
	protected $_db;
	
	public function __construct($db) {
		$this->_db = $db;
	
	}
	
	public function fetchAll() {
		$query = 'SELECT * FROM USE_CATEGORY ORDER BY SEQ';
		$resultSet = $this->_db->query($query);
		$entries = array ();
		foreach ( $resultSet as $row ) {
			$entry = new Models_UseCategory ();
			$entry->setUse_id ( $row['USE_ID'] );
			$entry->setUse_desp ( $row['USE_DESP'] );
			$entries [] = $entry;
		}
		return $entries;
	}
}

